<?php
/* 
 * ********* CVS HEADER ********* 
 * 
 * $RCSfile: admdownliste.php,v $ 
 * $Date: 2006/03/13 14:07:47 $ 
 * $Revision: 1.4 $ 
 * 
 * ********* CVS HEADER ********* 
 */
$L_modules = '';
$L_base_env = get_env_path();
require_once($L_modules . get_path_module("fonctions.fichiers"));
require_once("module/TPLN/TPLN.php");


$TPLN = new TPLN; 
$TPLN->Open($op_basepath.get_path("tpl")."admdownliste.html"); 
$TPLN->IncludeFile("header",$L_base_env.$session['environnement']."/header.php");
$TPLN->IncludeFile("footer",$L_base_env.$session['environnement']."/footer.php");

require_once(get_path_module("admin"));
$pc = new panneau_controle();
$pc->calculRubriqueParFonction($op);
$TPLN->Parse("panneau_controle",$pc->retourneEntete());

$query ="SELECT rportal_download.*,rportal_upload_path.path,groupe.nom AS droitnom";
$query.=" FROM rportal_download,rportal_upload_path,hierarchie,groupe";
$query.=" WHERE rportal_download.id_path_upload=rportal_upload_path.id";
$query.=" AND rportal_download.droit=hierarchie.id_groupe";
$query.=" AND hierarchie.id_groupe_dessus='".$session['id_groupe']."'";
$query.=" AND rportal_download.droit=groupe.id";
$query.=" ORDER BY rportal_download.id ASC";
$result=rportalrequete($query) or rportalerreur("ERREUR : $query","?op=");
if(rportalnbresult($result)==0){
    $TPLN->EraseBloc("bloc1");
}
$class="liste_impaire"; 
while($file=rportalligne($result)){
    $TPLN->Parse("bloc1.id",$file['id']);
    $TPLN->Parse("bloc1.filename",$file['filename']);
    $TPLN->Parse("bloc1.icone",GetIcone(file_ext($file['filename'])));
    $TPLN->Parse("bloc1.path",$file['path']);
    $TPLN->Parse("bloc1.fileonserver",$file['fileonserver']);
    $TPLN->Parse("bloc1.description",$file['description']);
    $TPLN->Parse("bloc1.droit",$file['droitnom']);
    $TPLN->Parse("bloc1.hit",$file['hit']);
    $TPLN->Parse("bloc1.classe",$class);
    $TPLN->Parse("bloc1.modif","?op=admdownadd&fid=".$file['id']);
    $TPLN->Parse("bloc1.down","?op=download&fid=".$file['id']);
    $TPLN->Parse("bloc1.supp","?op=admdownsupp&fid=".$file['id']);
    if($class!="liste_impaire") 
    { 
        $class="liste_impaire"; 
    }else{ 
        $class="liste_paire"; 
    }
    $TPLN->Loop("bloc1");
}
$TPLN->Parse("add","?op=admdownadd");
$TPLN->Write();
?>